﻿using System;
using Aspects.Custom;

namespace Aspects.Unit
{
    public class UnitBios
    {
        public static string GetBiosNumber()
        {
            byte BiosNumber = ECPort.DoubleReadEC(0xF8);
            if (BiosNumber == 0xFF)
            {
                //var temp = WmiProperty.GetProperty("Win32_BIOS", , "Version"); //doesn't work; can't find a valid qualifier
                return "False reading";
            }
            else
            {
                byte major = (byte)((BiosNumber & 0xC0) >> 6);
                byte minor = (byte)(BiosNumber & 0x3F);
                return string.Format("{0}.{1}", major, minor);
            }
        }
    }
    //bios 0xf8
    //xx.yy yy yy
}
